package com.answeringplayer.controller;

import com.answeringplayer.Bean.Request;
import com.answeringplayer.Bean.Response;
import com.answeringplayer.dto.PracticeRecordDTO;
import com.answeringplayer.dto.UserDTO;
import com.answeringplayer.service.QueryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("api/me")
public class QueryController {

    @Autowired
    QueryService queryService;

    @GetMapping("/scores")
    public Response  getScores(@RequestParam Long userId) {//GET请求的参数用@RequestParam接收
        return queryService.queryPracticeRecord(userId);
    }

    @GetMapping("wrong-questions")
    public Response  getWrongQuestions(@RequestParam Long userId) {
        return queryService.queryWrongQuestion(userId);
    }

}
